<?php
class AddTradeCoinAccountPromotionType extends Extension {
	function requireDefaultRecords(){
		if(!TradeCoinAccountType::get()->filter('Locale', 'en_US')->find('Code', 'Promotion')){
			TradeCoinAccountType::create()
			->setField('Code', 'Promotion')
			->setField('Title', 'Promotion')
			->setField('Sort', 68)
			->setField('Locale', 'en_US')
			->write();
		}
		
		if(!TradeCoinAccountType::get()->filter('Locale', 'zh_CN')->find('Code', 'Promotion')){
			TradeCoinAccountType::create()
			->setField('Code', 'Promotion')
			->setField('Title', '推广')
			->setField('Sort', 128)
			->setField('Locale', 'zh_CN')
			->write();
		}
	}
}
